/**
* AutoSWF - Cody Cushing. March 26, 2009
* Copyright (c) 2009 Cody Cushing
* No use restrictions. Maintain this notice in all versions. 
**/

package com.autoswf.taskrunner
{
	import flash.events.Event;


	public class TaskEvent extends Event
	{
		/** Task has completed, pass the result to the complete handler on the request object. */
		public static const TASK_COMPLETE:String = "loadComplete";
		
		/** Task has failed, pass the result to the fail handler on the request object. */
		public static const TASK_FAILURE:String = "loadFailure";
		
		/** TaskController: A primary task has completed, start a new primary or secondary task. */
		public static const PRIMARY_TASK_COMPLETE:String = "primaryTaskComplete";
		
		/** TaskController: A secondary task has completed, start a new secondary task. */
		public static const SECONDARY_TASK_COMPLETE:String = "secondaryTaskComplete";


		
		public var id:String;
		
		
		/**
		 * Constructor. 
		 * 
		 * @param id  Key used for retrieving the task result.
		 */		
		public function TaskEvent(type:String, id:String)
		{
			this.id = id;
			super(type);
		}
		
		
		override public function clone():Event
		{
			return new TaskEvent(type, id);
		}
	}
}